<%
  @title = subject.name

  docs = subject.toc_ordered_docs

  toc_html = subject.toc_html(prefix: "#")
%>

<div class="doc-section" id="doc-table-of-contents">
  <div class="doc-title"></div>
  <div class="section-body">
    <%= raw toc_html %>
  </div>
</div>

<% docs.each do |doc| %>
<div class="doc-section" id="doc-<%= doc.id %>">
  <h1 class="doc-title" id="<%= doc.slug %>"><%= doc.title %></h1>
  <div class="section-body">
    <%= raw doc.body_public_html %>
  </div>
</div>
<% end %>